// 常量路由
export const constantRoutes = [
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/Login/Login.vue'),
    meta: {
      title: '登录',
      hidden: true,
      icon: 'Promotion',
    },
  },
  {
    path: '/',
    name: 'layout',
    component: () => import('@/views/Layout/layout.vue'),
    meta: {
      title: 'layout',
      hidden: false,
      icon: 'Avatar',
    },
    redirect: '/home',
    children: [
      {
        name: 'home',
        path: '/home',
        component: () => import('@/views/Home/Home.vue'),
        meta: {
          title: '首页',
          hidden: false,
          icon: 'HomeFilled',
        },
      },
    ],
  },
  {
    name: '404',
    path: '/404',
    component: () => import('@/views/404/404.vue'),
    meta: {
      title: '404',
      hidden: true,
    },
  },
  {
    path: '/screen',
    name: 'Screen',
    component: () => import('@/views/screen/Screen.vue'),
    meta: {
      title: '数据大屏',
      hidden: false,
      icon: 'Monitor',
    },
  },
]

// 异步路由
export const asyncRoutes = [
  {
    path: '/acl',
    name: 'Acl',
    redirect: '/acl/user',
    component: () => import('@/views/Layout/layout.vue'),
    meta: {
      title: '权限管理',
      hidden: false,
      icon: 'Lock',
    },
    children: [
      {
        name: 'User',
        path: '/acl/user',
        component: () => import('@/views/acl/user/user.vue'),
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'UserFilled',
        },
      },
      {
        name: 'Role',
        path: '/acl/role',
        component: () => import('@/views/acl/role/role.vue'),
        meta: {
          title: '角色管理',
          hidden: false,
          icon: 'User',
        },
      },
      {
        path: '/acl/permission',
        component: () => import('@/views/acl/permission/permission.vue'),
        name: 'Permission',
        meta: {
          title: '菜单管理',
          icon: 'Monitor'
        }
      }
    ],
  },
  {
    path: '/product',
    name: 'Product',
    redirect: '/product/trademark',
    component: () => import('@/views/Layout/layout.vue'),
    meta: {
      title: '商品管理',
      hidden: false,
      icon: 'Goods',
    },
    children: [
      {
        name: 'Trademark',
        path: '/product/trademark',
        component: () => import('@/views/product/trademark/trademark.vue'),
        meta: {
          title: '品牌管理',
          hidden: false,
          icon: 'ShoppingCartFull',
        },
      },
      {
        name: 'Attr',
        path: '/product/attr',
        component: () => import('@/views/product/attr/attr.vue'),
        meta: {
          title: '属性管理',
          hidden: false,
          icon: 'TakeawayBox',
        },
      },
      {
        name: 'Spu',
        path: '/product/spu',
        component: () => import('@/views/product/spu/spu.vue'),
        meta: {
          title: 'SPU管理',
          hidden: false,
          icon: 'Goods',
        },
      },
      {
        name: 'Sku',
        path: '/product/sku',
        component: () => import('@/views/product/sku/sku.vue'),
        meta: {
          title: 'SKU管理',
          hidden: false,
          icon: 'ShoppingCartFull',
        },
      },
    ],
  },
]

export const anyRoutes = {
  path: '/:pathMatch(.*)*',
  redirect: '/404',
  name: 'Any',
  meta: {
    title: '任意路由',
    hidden: true,
  },
}
